﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace QunYing.Web.market
{
    public partial class notice : System.Web.UI.Page
    {
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Repeater rp = ((Repeater)Master.FindControl("NavRepeater"));
                rp.DataSource = NavData();
                rp.DataBind();
            }
        }
        /// <summary>
        /// 快捷导航数据
        /// </summary>
        private DataTable NavData()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("name");
            dt.Columns.Add("url");
            dt.Rows.Add("公告内容", "");
            return dt;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
            }
        }

        private void Bind()
        {
            string id = Request["id"];
            if (id == null)
            {
                lblTitle.Text = "无公告信息";
                return;
            }
            BLL.Notice notice = new BLL.Notice();
            Model.Notice model = notice.GetModel(Convert.ToInt32(id));
            lblTitle.Text = model.公告标题;
            lblContent.Text = model.公告内容;
            lblTime.Text = Convert.ToDateTime(model.发布时间).ToString("yyyy-MM-dd HH:mm:ss");
        }
    }
}
